package org.jeecg.modules.noRoadUpload.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.jeecg.modules.noRoadUpload.entity.NoRoadUpload;
import org.jeecg.modules.noRoadUpload.mapper.NoRoadUploadMapper;
import org.jeecg.modules.noRoadUpload.service.INoRoadUploadService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 非道路移动机械信息上传表
 * @Author: jeecg-boot
 * @Date:   2024-07-23
 * @Version: V1.0
 */
@Service
public class NoRoadUploadServiceImpl extends ServiceImpl<NoRoadUploadMapper, NoRoadUpload> implements INoRoadUploadService {

    @Override
    public NoRoadUpload getByRegistrationCode(String registrationCode) {
        LambdaQueryWrapper<NoRoadUpload> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(NoRoadUpload::getRegistrationCode, registrationCode);
        wrapper.orderByDesc(NoRoadUpload::getCreateTime);
        wrapper.last("limit 1");
        return baseMapper.selectOne(wrapper);
    }
}
